﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="layer.aspx.cs" Inherits="editormd.layer" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>editor.md示例</title>
    <link rel="stylesheet" href="css/editormd.css" />
	<link type="text/css" rel="Stylesheet" href="WordPaster/css/WordPaster.css"/>
    <script type="text/javascript" src="WordPaster/js/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/jquery-1.8.3.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/layer-3.1.1/layer.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.file.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.layer.js" charset="utf-8"></script>
    <script src="turndown.js"></script>
    <script src="editormd/editormd.min.js"></script>
</head>
<body>
    <p><a href="index.aspx" target="_blank">skygqbox弹窗组件</a></p>
    <p>Markdown转换组件采用<a href="https://github.com/domchristie/turndown">turndown</a></p>
    <p><a href="https://pandao.github.io/editor.md/" target="_blank">Editor.md官网</a></p>
    <div id="test-editor">
        <textarea style="display: none;">### WordPaster for editor.md
    </textarea>
    </div>
    <script type="text/javascript">
        var wdp = WordPaster.getInstance({
            PostUrl: "http://localhost:63122/upload.aspx",
            Cookie: 'ASP.NET_SessionId=<%=Session.SessionID%>'
        }).Load();//加载控件

        $(function () {
            var editor = editormd("test-editor", {
                // width  : "100%",
                // height : "100%",
                path: "editormd/lib/",
                htmlDecode : false,
                autoHeight: true,
                toolbarIcons: function () {
                    return ["undo", "redo", "|", "bold", "hr", "|", "preview", "watch", "|", "fullscreen", "info", "file", "faicon", "||", "watch", "fullscreen", "preview", "wordpaster","pptpaster","netpaster"];
                },
                toolbarIconsClass : {
                        wordpaster : "fa-file-word-o",  // 指定一个FontAawsome的图标类
                        pptpaster : "fa-file-powerpoint-o",  // 指定一个FontAawsome的图标类
                        netpaster:"fa-google-plus"
                },
                toolbarIconTexts: { wordpaster: "Word图片一键粘贴" ,pptpaster:"PowerPoint一键粘贴",netpaster:"网络图片一键上传"},
                //toolbarCustomIcons: {
                //    wordpaster:"<img src='WordPaster/css/w.png' title='Word图片一键粘贴'/>",
                //    pptpaster:"<img src='WordPaster/css/ppt.png' title='PowerPoint一键粘贴'/>",
                //    netpaster:"<img src='WordPaster/css/net.png' title='网络图片一键上传'/>"
                //},
                toolbarHandlers: {
                    wordpaster: function (cm, icon, cursor, selection) {
                        wdp.Paste();
                    },
                    pptpaster: function (cm, icon, cursor, selection) {
                        wdp.Paste();
                    },
                    netpaster: function (cm, icon, cursor, selection) {
                        wdp.Paste();
                    }
                },
                lang: {
                    toolbar: {wordpaster:"Word图片一键粘贴",pptpaster:"PowerPoint一键粘贴",netpaster:"网络图片一键上传"}
                },
                onload: function () {
                    wdp.SetEditor(this);
                }
            });
        });
    </script>
</body>
</html>
